package com.diandi.ddsb.bean;

/**
 * 收益类型枚举
 * 
 * @author dongjie
 *  
 */

public enum InvestType {

	BORROW_INVEST(0, "散标投资"), PLANT_D_INVEST(1, "活期宝投资"), PLANT_ATUO_INVEST(2, "省心计划投资"), BORROW_TASTE(3, "体验标投资"), IPHONE_INVEST(
			4, "苹果专享标"), YACHT_INVEST(5, "游艇投资"), HOTEL_INVEST(6, "酒店投资"), GAS_INVEST(7, "油分期类型"), MJ_INVEST(8, "秒借投资"), YYFQ_INVEST(
			9, "有用分期"), CAR_CREDIT_INVEST(10, "车信宝"), MEIRONG_INVEST(11, "美容分期");

	/**
	 * value
	 */
	private final String text;
	/**
	 * key
	 */
	private final int value;

	InvestType(int value, String text) {
		this.value = value;
		this.text = text;
	}

	public static InvestType getByType(int type) {
		for (InvestType item : InvestType.values()) {
			if (item.getValue() == type) {
				return item;
			}
		}
		throw new RuntimeException(type + "不是InvestType的合法type");
	}

	public String getText() {
		return text;
	}

	public int getValue() {
		return value;
	}

}
